<!DOCTYPE html>
<html>
    <head>
        <title>hi</title>
    </head>
    <body id="body">
        <script>
            // var WshShell = new ActiveXObject("wscript.Shell");
            // WshShell.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Excel\Security\AccessVBOM",1,"REG_DWORD");
            // WshShell.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security\AccessVBOM",1,"REG_DWORD");
            // WshShell.RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Security\AccessVBOM",1,"REG_DWORD");

            var oExcel = new ActiveXObject("Excel.Application");
            var oBook = oExcel.Workbooks.Add();
            var oModule = oBook.VBProject.VBComponents.Add(1);
            var strCode = "Function A(X)\nA = X * 10\nEnd Function";
            oModule.CodeModule.AddFromString(strCode);

            alert(oExcel.Run("A", 123));

            oExcel.DisplayAlerts = false;
            oBook.Close();
            oExcel.Quit();
        </script>
    </body>
</html>